package com.itheima.Demo5;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;

public class Demo {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("day0731\\names.txt"));
        ArrayList<String> name = new ArrayList<>();
        String s;
        while((s = br.readLine()) != null){
            name.add(s);
        }
        br.close();
        Random random = new Random();

        System.out.println(name.get(random.nextInt(name.size())));

    }
}
